package com.my.swas.photo.controller;



/**
 * @Description:
 * @author: :MaYong
 */
public enum FileSizeEnum {
    ONE("1",295,413,"25*35mm",50),
    PASSPORT("2",390,567,"480*330mm",90),
    SMALL_ONE("3",260,378,"22*32mm",50),
    TOW("4",413,597,"35*49mm",100),
    ID_CARD("5",260,390,"22*32mm",50),
    DRIVER_LICENSE("6",260,390,"22*32mm",50);

    private String code;
    private Integer width;
    private Integer height;
    private String size;
    private Integer binocularSpacing;


    FileSizeEnum(String code, Integer width, Integer height, String size, Integer binocularSpacing) {
        this.code = code;
        this.width = width;
        this.height = height;
        this.size = size;
        this.binocularSpacing = binocularSpacing;
    }

    public static String getSize(String code){
        for(FileSizeEnum fs : FileSizeEnum.values()){
            if(code.equals(fs.code)){
                return fs.size;
            }
        }
        return null;
    }

    public static Integer getWidth(String code) {
        for(FileSizeEnum fs : FileSizeEnum.values()){
            if(code.equals(fs.code)){
                return fs.width;
            }
        }
        return null;
    }

    public static Integer getHeight(String code) {
        for(FileSizeEnum fs : FileSizeEnum.values()){
            if(code.equals(fs.code)){
                return fs.height;
            }
        }
        return null;
    }

    public static Integer getBinocularSpacing(String code) {
        for(FileSizeEnum fs : FileSizeEnum.values()){
            if(code.equals(fs.code)){
                return fs.binocularSpacing;
            }
        }
        return null;
    }


    public FileSizeEnum getEnum(String code) {
        for(FileSizeEnum fs : FileSizeEnum.values()){
            if(code.equals(fs.code)){
                return fs;
            }
        }
        return null;
    }

    public String getSize(FileSizeEnum fileSizeEnum) {
        for(FileSizeEnum fs : FileSizeEnum.values()){
            if(fileSizeEnum.code.equals(fs.code)){
                return fs.size;
            }
        }
        return null;
    }

    public static String getCode(FileSizeEnum fileSizeEnum){
        for(FileSizeEnum fs : FileSizeEnum.values()){
            if(fileSizeEnum.code.equals(fs.code)){
                return fs.code;
            }
        }
        return null;
    }

    public static Integer getWidth(FileSizeEnum fileSizeEnum) {
        for(FileSizeEnum fs : FileSizeEnum.values()){
            if(fileSizeEnum.code.equals(fs.code)){
                return fs.width;
            }
        }
        return null;
    }

    public static Integer getHeight(FileSizeEnum fileSizeEnum) {
        for(FileSizeEnum fs : FileSizeEnum.values()){
            if(fileSizeEnum.code.equals(fs.code)){
                return fs.height;
            }
        }
        return null;
    }

    public static Integer getBinocularSpacing(FileSizeEnum fileSizeEnum) {
        for(FileSizeEnum fs : FileSizeEnum.values()){
            if(fileSizeEnum.code.equals(fs.code)){
                return fs.binocularSpacing;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public Integer getWidth() {
        return width;
    }

    public Integer getHeight() {
        return height;
    }

    public String getSize() {
        return size;
    }

    public Integer getBinocularSpacing() {
        return binocularSpacing;
    }
}
